package le;

import java.util.List;
import java.util.ArrayList;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class LexicalEntry {
	
	public List<Pattern> patterns = new ArrayList<Pattern>();
	
	public LexicalEntry(Element e) {
		NodeList ns = e.getChildNodes();
		for (int i=0;i<ns.getLength();i++) {
			Node n = ns.item(i);
			String s = n.getNodeName();
			if (s.equals("FEGroupRealizations")) {
				NodeList ps = ((Element) n).getChildNodes();
				for (int j=0;j<ps.getLength();j++) {
					Node p = ps.item(j);
					if (p.getNodeName().equals("FEGroupRealization")) {
						NodeList qs = ((Element) p).getChildNodes();
						for (int k=0;k<qs.getLength();k++) {
							Node q = qs.item(k);
							if (q.getNodeName().equals("pattern")) {
								patterns.add(new Pattern((Element) q));
							}
						}														
					}
				}				
			}
		}
	}
	
}
